<template>
  <el-row :gutter="20" style="  margin-bottom: 20px;">
    <el-col :span="6" v-for="(item, index) in statsData" :key="index">
      <el-card shadow="hover">
        <div class="stat-card">
          <div class="stat-title">{{ item.title }}</div>
          <div class="stat-number">{{ item.value }}</div>
          <div class="stat-compare">
            较昨日
            <el-tag :type="item.increase > 0 ? 'danger' : 'success'" size="small">
              {{ item.increase > 0 ? '+' : '' }}{{ item.increase }}
            </el-tag>
          </div>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>

<script setup>
import { ref } from 'vue'

const statsData = ref([
  { title: '订单数量', value: '1,280', increase: 32 },
  { title: '商品评论数', value: '3,650', increase: 56 },
  { title: '销售额', value: '￥25,630', increase: -12 },
  { title: '商品数量', value: '892', increase: 24 }
])
</script>

<style lang='scss' scoped>
.stat-card {
  text-align: center;
  
  .stat-title {
    color: #909399;
    font-size: 14px;
  }
  
  .stat-number {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
    color: #303133;
  }
  
  .stat-compare {
    font-size: 12px;
    color: #909399;
  }
}

.chart-card {
  margin-bottom: 20px;
  
  .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    
    h3 {
      margin: 0;
    }
  }
}
</style>